@import url(https://fonts.gooleapis.com/css?family=Open+Sans:600);

.frame{
    position: absolute;
    width: 400px;
    height: 400px;
    box-shadow: 1px 2px 10px rgba(0,0,0,0.3);
    border-radius: 2px;
    inset: 0;
    margin: auto;
    background-color: #57d895;
    color: #fff;
    font-family: 'Open Sans',Arial, Helvetica, sans-serif;
    overflow: hidden;
}

.hidden{
    display: none;
}


.button{
    box-sizing: border-box;
    position: absolute;
    display: block;
    width: 260px;
    height: 60px;
    top: 170px;
    left: 70px;
    text-align: center;
    line-height: 57px;
    border: 2px solid #fff;
    border-radius: 30px;
    font-size: 20px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all .3s ease-in-out;

    &:hover{
        background-color: #37be77;
    }

    img{
        position: absolute;
        z-index: 2;
        inset: 0;
        margin: auto;
        opacity: 0;
    }
}

.circle{
    position: absolute;
    width: 60px;
    height: 60px;
    inset: 0;
    margin: auto;
    fill: none;
    stroke: #fff;
    stroke-width: 2px;
    stroke-linecap: round;
    stroke-dasharray: 183 183;
    stroke-dashoffset: 183;
    pointer-events: none;
    transform: rotate(-90deg);
    
}


input:checked{
    & ~ .button{
        animation: button .5s ease forwards, fill .5s ease-out 1.5s forwards
    }

    & ~ .button img{
        animation: check .5s ease-out 1.5s both;
    }

    & ~ .circle{
        animation: circle 2s ease-out .5s both;
    }
}

@keyframes button{
    0%{
        width: 260px;
        left: 70px;
        border-color: #fff;
        color: #fff;
    }
    50%{
        color: transparent;
    }
    100%{
        left: 170px;
        width: 60px;
        border-color: #45b078;
        background-color: transparent;
        color: transparent;
    }
}

@keyframes circle {
    0%{
        stroke-dashoffset: 183;
    }
    50%{
        stroke-dashoffset: 0;
        stroke-dasharray: 183;
        transform: rotate(-90deg) scale(1);
        opacity: 1;
    }
    90%,100%{
        stroke-dasharray: 500 500;
        transform: rotate(-90deg) scale(2);
        opacity: 0;
    }
}

@keyframes check{
    0%{
        opacity: 0;
    }
    100%{
        opacity: 1;
    }
}

@keyframes fill{
    0%{
        background-color: transparent;
        border-color: #fff;
    }
    100%{
        background-color: #fff;
    }
}